
import Helper from 'source/mixins/helper.mixin'

export default {

    storageSet (key, data) {
        return Helper.helperFnPromise('setStorage', {key, data});
    },

    storageGet (key) {
        return new Promise(((resolve, reject) => {
            Helper.helperFnPromise('getStorage', {key}).then((res) => {
                const data = res ? res.data : null;
                data ? resolve(data) : reject(data)
            }).catch(reject);
        }));
    },

    storageDel (key) {
        return Helper.helperFnPromise('removeStorage', {key});
    },

    storageCls (key) {
        return Helper.helperFnPromise('clearStorage');
    },

}
